﻿using Microsoft.AspNetCore.Mvc;
using Web.Middlewares;

namespace Web.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class SettingController : ControllerBase
    {
        public ISettingService _service { get; set; }
        public SettingController(ISettingService service)
        {
            _service = service;
        }
        [HttpGet]
        public async Task<List<KeyValue>> Get([FromQuery] SettingRequest request)
        {
            return await _service.Get(request);
        }
        [HttpPost, OperationLogTag(title: "修改配置", recordBody: RecordBody.none)]
        public Task Save([FromBody] List<KeyValue> request)
        {
            return _service.Save(request);
        }
        [HttpGet]
        public async Task<List<ServiceResponse>> GetService()
        {
            return await _service.GetService();
        }
    }
}